
<div id="queryview-section-d73980dd71c541b9b99b0b77122883dd" class="grid" style="border: 1px solid #eee;">
    <input type="hidden" name="allsubgirddata" value="" />
    <input type="hidden" name="tempdata" value="" />
    <input type="hidden" name="resdata" value="" />
    <div class="container-fluid" style="padding:3px;">
        <div class="toolbar">
            <div class="pull-left" style="line-height:35px;">
            </div>
            <div class="pull-right">
                <table style="position:relative;">
                    <tr>
                        <td>
                            <div class="input-group input-group-sm col-sm-4">
                                <input class="form-control quickly-search-input" id="Q" name="Q" placeholder="快速查询" style="width:200px;" type="text" value="" />
                                <span class="input-group-btn">
                                    <button class="btn btn-default" name="clearBtn" type="button" title="清空">
                                        <span class="glyphicon glyphicon-remove-sign"></span>
                                    </button>
                                    <button class="btn btn-default" name="searchBtn" type="button">
                                        <span class="glyphicon glyphicon-search"></span>
                                    </button>
                                </span>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="pos_re gridview" id="gridview">
        <div class="">
            <div class="table-responsive tableReWidth" id="tableReWidth" style="min-height:200px;max-height:300px;">
                <table class="table table-hover table-striped table-condensed datatable tableheaderResize" id="" data-pageurl="/xms/entity/rendergridview?__r=1636792674611" data-ajax="true" data-ajaxcontainer="gridview" data-sortby="createdon" data-sortdirection="1" style="border-top: 1px solid lightgrey; max-width:none;">
                    <thead>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<script src="/content/js/jquery.bootpag.min.js"></script>
<script src="/content/js/jquery.form.js"></script>
<script src="/content/js/fetch.js"></script>
<script>
    var pageRenderGridViewInfo = {
        sectionid: '#queryview-section-d73980dd71c541b9b99b0b77122883dd',
        gridid: '',
        iseditable:true,
        pageUrl: $("#queryview-section-d73980dd71c541b9b99b0b77122883dd .datatable").attr('data-pageurl'),
        queryid: '',
        entityid: '',
        entityname: '',
        entityloclaizedname: '',
        filters: null,
        sortby: 'createdon',
        sortdir: '1',
        q: '',
        defaultEmptyRows: '5',//初始化行数
        pagingEnabled: true,
        qfield: '',
        page: 1,
        pagesize: 6,
        relationshipmeta: null,
        relationshipname: '',
        referencedrecordid: '',
        referencingattributename: '',
        //gridconfig:[{"name":"productid", "editable":true},{"name":"quantity", "editable":true, "onchange":{"func":"update","target":"amount"}},{"name":"price", "editable":true, "bind":"model.price", "onchange":{"func":"update","target":"amount"}},{"name":"discountamount", "editable":true, "onchange":{"func":"update","target":"amount"}},{"name":"amount", "editable":false, "exp":"row.price*row.quantity-row.discountamount"}],
        records: [],
        nameprefix: '',
        editrowmodel: null,
        createmode: Xms.Page && Xms.Page.PageContext && Xms.Page.PageContext.RecordId == null ? 'local' : 'server'//local or server
    }
</script>
<script src="/content/js/pages/entity.rendergridview.js"></script>
<script>

    function formSaveSubGrid(){
        var check = checkSubGridData();
        //console.log('checkxxxxxxxxxxxxxxxxx',check)
        if(!check)return false;
        var flag = true;
        for(var key in GridViewModel){
            var sfl = true;
            if(GridViewModel.hasOwnProperty(key)){
                sfl = GridViewModel[key].savetable();
            }
            if(sfl==false){
                flag = false;
                //break;
            }
        }
        console.log('flag',flag);
        if(flag){
            var res = [];
            $('input[name="resdata"]').each(function(){
                if(!$(this).val()||$(this).val()=="")return true;
                var temp = JSON.parse(decodeURIComponent($(this).val()));
                res = res.concat(temp);
            });
            $('input[name="child"]').val('').val(encodeURIComponent(JSON.stringify(res)));
            console.log('提交单据体的数据',res)
            //console.log('提交单据体的数据2',JSON.parse(decodeURIComponent(resultValue)));
            dirtyChecker.isDirty = true;
        }
        return flag;
    }
</script>